{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#   [Py4Hw Tutorial](../Tutorial.ipynb)> 0.2 Cloning"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The development version of Py4HW is also available from the repository in Github. The version in pypi is more stable, so it should be the preferred method, **you can skip this step**. Still, if you want to work with the development version you can clone it with \n",
    "\n",
    "`git clone https://github.com/davidcastells/py4hw`\n",
    "\n",
    "in your python console. In jupyter notebooks just run the following cell:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Cloning into 'py4hw'...\n"
     ]
    }
   ],
   "source": [
    "!git clone https://github.com/davidcastells/py4hw"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "After cloning the library, do a pip install in ***editable** mode\n",
    "\n",
    "`pip install -e py4hw`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "After installing you will need to import the library, with a regular import"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import py4hw"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can check the version of the library by running..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current py4hw version = 0.0.12\n"
     ]
    }
   ],
   "source": [
    "import pkg_resources\n",
    "print('Current py4hw version =', pkg_resources.get_distribution('py4hw').version)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
